Update to latest upstream release
This commit is contained in:
parent
9883ad0e4f
commit
2ed0214e6d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/0ad-0.0.14-alpha-unix-build.tar.xz
|
||||
/0ad-0.0.15-alpha-unix-build.tar.xz
|
||||
/0ad-0.0.16-alpha-unix-build.tar.xz
|
||||
/0ad-0.0.17-alpha-unix-build.tar.xz
|
||||
|
@ -1,18 +1,20 @@
|
||||
diff -up 0ad-0.0.15-alpha/libraries/source/fcollada/src/Makefile.orig 0ad-0.0.15-alpha/libraries/source/fcollada/src/Makefile
|
||||
--- 0ad-0.0.15-alpha/libraries/source/fcollada/src/Makefile.orig 2013-12-27 17:28:17.825656505 -0200
|
||||
+++ 0ad-0.0.15-alpha/libraries/source/fcollada/src/Makefile 2013-12-27 17:30:47.874662251 -0200
|
||||
@@ -9,10 +9,7 @@ endif
|
||||
diff -up 0ad-0.0.17-alpha/libraries/source/fcollada/src/Makefile.orig 0ad-0.0.17-alpha/libraries/source/fcollada/src/Makefile
|
||||
--- 0ad-0.0.17-alpha/libraries/source/fcollada/src/Makefile.orig 2014-10-12 13:09:01.753202818 -0300
|
||||
+++ 0ad-0.0.17-alpha/libraries/source/fcollada/src/Makefile 2014-10-12 13:13:01.351211993 -0300
|
||||
@@ -9,12 +9,9 @@ endif
|
||||
|
||||
CXX ?= g++
|
||||
CXXFLAGS += -fvisibility=hidden -W -Wall -Wno-unused-parameter -Wno-unused-function $(OS_DEFINE) $(PIC_FLAGS) $(CPPFLAGS)
|
||||
-CXXFLAGS_DEBUG := -O0 -g -D_DEBUG -DRETAIL
|
||||
CXXFLAGS_RELEASE := -O1 -DNDEBUG -DRETAIL
|
||||
-# (-O2 with gcc 4.3 causes linker errors when using this library, for unknown reasons, so stick with -O1 until gcc >4.3 is typical.)
|
||||
CXXFLAGS_RELEASE := -O2 -DNDEBUG -DRETAIL
|
||||
-CXXFLAGS_TEST := -O0 -g -D_DEBUG
|
||||
LIBS += `pkg-config libxml-2.0 --libs`
|
||||
INCLUDES += -IFCollada `pkg-config libxml-2.0 --cflags`
|
||||
INCLUDES_TEST := -IFCollada/FColladaTest $(INCLUDES)
|
||||
@@ -181,72 +178,19 @@ SOURCE = \
|
||||
-INCLUDES_TEST := -IFCollada/FColladaTest $(INCLUDES)
|
||||
|
||||
# FCollada is not aliasing-safe, so disallow dangerous optimisations
|
||||
# (TODO: It'd be nice to fix FCollada, but that looks hard)
|
||||
@@ -180,72 +177,19 @@ SOURCE = \
|
||||
FColladaPlugins/FArchiveXML/FAXSceneExport.cpp \
|
||||
FColladaPlugins/FArchiveXML/FAXSceneImport.cpp \
|
||||
|
||||
@ -61,8 +63,8 @@ diff -up 0ad-0.0.15-alpha/libraries/source/fcollada/src/Makefile.orig 0ad-0.0.15
|
||||
-OBJECTS_ALL = $(OBJECTS_DEBUG) $(OBJECTS_RELEASE) $(OBJECTS_TEST)
|
||||
+OBJECTS_ALL = $(OBJECTS_RELEASE)
|
||||
|
||||
-all: output_dirs output/libFColladaSD.a output/libFColladaSR.a install
|
||||
+all: output_dirs output/libFColladaSR.a install
|
||||
-all: output/libFColladaSD.a output/libFColladaSR.a install
|
||||
+all: output/libFColladaSR.a install
|
||||
|
||||
output_dirs:
|
||||
- bash -c 'mkdir -p output/{debug,release,test}/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}'
|
||||
@ -71,16 +73,16 @@ diff -up 0ad-0.0.15-alpha/libraries/source/fcollada/src/Makefile.orig 0ad-0.0.15
|
||||
- ( cd FCollada/FColladaTest/ ; ../../output/FColladaTest )
|
||||
- cat FCollada/FColladaTest/FColladaTestLog.txt
|
||||
-
|
||||
-output/libFColladaSD.a: $(OBJECTS_DEBUG)
|
||||
-output/libFColladaSD.a: $(OBJECTS_DEBUG) | output_dirs
|
||||
- @echo "$@"
|
||||
- @ar -cr $@ $(OBJECTS_DEBUG); ranlib $@
|
||||
+ bash -c 'mkdir -p output/release/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}'
|
||||
|
||||
output/libFColladaSR.a: $(OBJECTS_RELEASE)
|
||||
output/libFColladaSR.a: $(OBJECTS_RELEASE) | output_dirs
|
||||
@echo "$@"
|
||||
@ar -cr $@ $(OBJECTS_RELEASE); ranlib $@
|
||||
|
||||
-output/FColladaTest: $(OBJECTS_TEST)
|
||||
-output/FColladaTest: $(OBJECTS_TEST) | output_dirs
|
||||
- $(CXX) -o $@ $(LDFLAGS) $(OBJECTS_TEST) $(LIBS)
|
||||
-
|
||||
-install: output/libFColladaSD.a output/libFColladaSR.a
|
||||
@ -89,19 +91,19 @@ diff -up 0ad-0.0.15-alpha/libraries/source/fcollada/src/Makefile.orig 0ad-0.0.15
|
||||
cp output/libFColladaSR.a ../lib/libFColladaSR.a
|
||||
|
||||
dfile = $(@:.o=.d)
|
||||
@@ -256,18 +200,10 @@ gendep = \
|
||||
@@ -255,18 +199,10 @@ gendep = \
|
||||
sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
|
||||
-e '/^$$/ d' -e 's/$$/ :/' < $(dfile) >> $(Pfile) && \
|
||||
rm -f $(dfile)
|
||||
-output/debug/%.o: %.cpp
|
||||
-output/debug/%.o: %.cpp | output_dirs
|
||||
- @echo "$<"
|
||||
- $(CXX) $(CXXFLAGS) $(CXXFLAGS_DEBUG) $(INCLUDES) -MD -MF $(dfile) -c $< -o $@
|
||||
- $(gendep)
|
||||
output/release/%.o: %.cpp
|
||||
output/release/%.o: %.cpp | output_dirs
|
||||
@echo "$<"
|
||||
$(CXX) $(CXXFLAGS) $(CXXFLAGS_RELEASE) $(INCLUDES) -MD -MF $(dfile) -c $< -o $@
|
||||
$(gendep)
|
||||
-output/test/%.o: %.cpp
|
||||
-output/test/%.o: %.cpp | output_dirs
|
||||
- @echo "$<"
|
||||
- $(CXX) $(CXXFLAGS) $(CXXFLAGS_TEST) $(INCLUDES_TEST) -MD -MF $(dfile) -c $< -o $@
|
||||
- $(gendep)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +0,0 @@
|
||||
diff -up 0ad-0.0.15-alpha/source/network/NetServer.cpp.orig 0ad-0.0.15-alpha/source/network/NetServer.cpp
|
||||
--- 0ad-0.0.15-alpha/source/network/NetServer.cpp.orig 2014-04-18 12:08:43.415641350 -0300
|
||||
+++ 0ad-0.0.15-alpha/source/network/NetServer.cpp 2014-04-18 12:09:27.221643028 -0300
|
||||
@@ -274,7 +274,7 @@ void* CNetServerWorker::SetupUPnP(void*)
|
||||
// Check that the port was actually forwarded.
|
||||
ret = UPNP_GetSpecificPortMappingEntry(urls.controlURL,
|
||||
data.first.servicetype,
|
||||
- psPort, protocall,
|
||||
+ psPort, protocall, externalIPAddress,
|
||||
intClient, intPort, NULL/*desc*/,
|
||||
NULL/*enabled*/, duration);
|
||||
|
@ -1,6 +1,7 @@
|
||||
--- 0ad-0.0.16-alpha/build/premake/premake4.lua.orig 2014-05-17 22:21:52.787713008 +0200
|
||||
+++ 0ad-0.0.16-alpha/build/premake/premake4.lua 2014-05-17 22:22:39.659845979 +0200
|
||||
@@ -356,26 +356,6 @@
|
||||
diff -up 0ad-0.0.17-alpha/build/premake/premake4.lua.orig 0ad-0.0.17-alpha/build/premake/premake4.lua
|
||||
--- 0ad-0.0.17-alpha/build/premake/premake4.lua.orig 2014-10-12 13:06:42.529197486 -0300
|
||||
+++ 0ad-0.0.17-alpha/build/premake/premake4.lua 2014-10-12 13:07:15.767198759 -0300
|
||||
@@ -384,26 +384,6 @@ function project_set_build_flags()
|
||||
defines { "INSTALLED_LIBDIR=" .. _OPTIONS["libdir"] }
|
||||
end
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
diff -up 0ad-0.0.16-alpha/build/premake/extern_libs4.lua.orig 0ad-0.0.16-alpha/build/premake/extern_libs4.lua
|
||||
--- 0ad-0.0.16-alpha/build/premake/extern_libs4.lua.orig 2014-09-14 11:05:13.723088670 -0300
|
||||
+++ 0ad-0.0.16-alpha/build/premake/extern_libs4.lua 2014-09-14 11:05:33.262089418 -0300
|
||||
@@ -667,10 +667,7 @@ extern_lib_defs = {
|
||||
diff -up 0ad-0.0.17-alpha/build/premake/extern_libs4.lua.orig 0ad-0.0.17-alpha/build/premake/extern_libs4.lua
|
||||
--- 0ad-0.0.17-alpha/build/premake/extern_libs4.lua.orig 2014-10-12 13:18:25.785224416 -0300
|
||||
+++ 0ad-0.0.17-alpha/build/premake/extern_libs4.lua 2014-10-12 13:19:03.535225862 -0300
|
||||
@@ -673,10 +673,7 @@ extern_lib_defs = {
|
||||
},
|
||||
valgrind = {
|
||||
compile_settings = function()
|
||||
|
70
0ad.6
70
0ad.6
@ -1,7 +1,7 @@
|
||||
.TH 0AD "6" "May 17 2014" "0ad 0.0.16 Patañjali" "User Commands"
|
||||
.TH 0AD "6" "Oct 12 2014" "0ad 0.0.17 Quercus" "User Commands"
|
||||
|
||||
.SH NAME
|
||||
0ad \- manual page for 0ad 0.0.16 Patañjali
|
||||
0ad \- manual page for 0ad 0.0.17 Quercus
|
||||
.SH SYNOPSIS
|
||||
.B 0ad
|
||||
[\fIoptions\fR]
|
||||
@ -19,13 +19,13 @@ hobbyist game developers, since 2001.
|
||||
.PP
|
||||
Basic gameplay:
|
||||
.TP
|
||||
\fB\-autostart\fR
|
||||
\fB\-autostart\fR=...
|
||||
load a map instead of showing main menu (see below)
|
||||
.TP
|
||||
\fB\-editor\fR
|
||||
launch the Atlas scenario editor
|
||||
.TP
|
||||
\fB\-mod\fR \fINAME\fR
|
||||
\fB\-mod\fR=\fINAME\fR
|
||||
start the game using \fINAME\fR mod
|
||||
.TP
|
||||
\fB\-quickstart\fR
|
||||
@ -34,56 +34,51 @@ load faster (disables audio and some system info logging)
|
||||
.PP
|
||||
Autostart:
|
||||
.TP
|
||||
\fB\-autostart\fR=\fINAME\fR
|
||||
map \fINAME\fR for scenario, or rms name for random map
|
||||
\fB\-autostart\fR="\fITYPEDIR\fR/\fIMAPNAME\fR"
|
||||
enables autostart and sets \fIMAPNAME\fR; \fITYPEDIR\fR is \fIskirmishes\fR,
|
||||
\fIscenarios\fR, or \fIrandom\fR
|
||||
.TP
|
||||
\fB\-autostart-ai\fR=\fIPLAYER\fR:\fIAI\fR
|
||||
adds named \fIAI\fR to the given \fIPLAYER\fR (e.g. 2:testbot)
|
||||
sets the \fIAI\fR for \fIPLAYER\fR (e.g. 2:petra)
|
||||
.TP
|
||||
\fB-autostart-aidiff\fR=\fIPLAYER\fR:\fIlevel\fR
|
||||
changes the difficulty setting for \fIAI PLAYER\fR (0: easy, 3: very hard)
|
||||
\fB-autostart-aidiff\fR=\fIPLAYER\fR:\fIDIFF\fR
|
||||
sets the \fIDIFF\fRiculty of \fIPLAYER\fR's \fIAI\fR (0: easy, 3: very hard)
|
||||
.TP
|
||||
\fB-autostart-civ\fR=\fIPLAYER\fR:\fICIV\fR
|
||||
sets \fIPLAYER\fR's civilisation to \fICIV\fR (skirmish and random maps only)
|
||||
|
||||
.PP
|
||||
Multiplayer:
|
||||
.TP
|
||||
\fB\-autostart-playername\fR=\fINAME\fR
|
||||
multiplayer local player \fINAME\fR (default 'anonymous')
|
||||
sets local player \fINAME\fR (default 'anonymous')
|
||||
.TP
|
||||
\fB\-autostart-host\fR
|
||||
multiplayer host mode
|
||||
sets multiplayer host mode
|
||||
.TP
|
||||
\fB\-autostart-players\fR=\fINUMBER\fR
|
||||
multiplayer host: \fINUMBER\fR of client players (default 2)
|
||||
\fB\-autostart-host-players\fR=\fINUMBER\fR
|
||||
sets \fINUMBER\fR of human players for multiplayer games (default 2)
|
||||
.TP
|
||||
\fB\-autostart-client\fR
|
||||
multiplayer client mode
|
||||
.TP
|
||||
\fB\-autostart-ip\fR=\fIIP\fR
|
||||
multiplayer client: connect to this host \fIIP\fR
|
||||
\fB\-autostart-client\fR=\fIIP\fR
|
||||
sets multiplayer client to join host host at given \fIIP\fR address
|
||||
|
||||
.PP
|
||||
Random maps only:
|
||||
.TP
|
||||
\fB\-autostart-random\fR
|
||||
random map
|
||||
.TP
|
||||
\fB\-autostart-random\fR=\fISEED\fR
|
||||
random map with \fISEED\fR value (default 0, use -1 for random)
|
||||
\fB\-autostart-seed\fR=\fISEED\fR
|
||||
sets random map \fISEED\fR value (default 0, use -1 for random)
|
||||
.TP
|
||||
\fB\-autostart-size\fR=\fITILES\fR
|
||||
random map \fISIZE\fR in tiles (default 192)
|
||||
sets random map size in \fITILES\fR (default 192)
|
||||
.TP
|
||||
\fB\-autostart-players\fR=\fINUMBER\fI
|
||||
\fINUMBER\fR of players on random map
|
||||
.TP
|
||||
\fB-autostart-civ\fR=\fIPLAYER\fR:\fICIV\fR
|
||||
changes the civilisation of player \fIPLAYER\fR to \fICIV\fR (default athen)
|
||||
sets \fINUMBER\fR of players on random map (default 2)
|
||||
|
||||
.PP
|
||||
Configuration:
|
||||
.TP
|
||||
\fB\-conf\fR:\fIKEY\fR=\fIVALUE\fR
|
||||
set a config value (overrides the contents of system.cfg)
|
||||
\fB\-conf\fR=\fIKEY\fR:\fIVALUE\fR
|
||||
set a config value
|
||||
.TP
|
||||
\fB\-g\fR=\fIF\fR
|
||||
set the gamma correction to '\fIF\fR' (default 1.0)
|
||||
@ -124,7 +119,7 @@ complete entity XML schema, used by various analysis tools
|
||||
.TP
|
||||
\fB\-replay\fR=\fIPATH\fR
|
||||
non-visual replay of a previous game, used for analysis purposes
|
||||
\fIPATH\fR is system path to commands.txt containing simulation log
|
||||
\fIPATH\fR is system path to \fIcommands.txt\fR containing simulation log
|
||||
.TP
|
||||
\fB\-writableRoot\fR
|
||||
store runtime game data in root data directory
|
||||
@ -145,6 +140,7 @@ Archive builder:
|
||||
.TP
|
||||
\fB\-archivebuild\fR=\fIPATH\fR
|
||||
system \fIPATH\fR of the base directory containing mod data to be archived/precached
|
||||
specify all mods it depends on with \fB-mod\fR=\fINAME\fR
|
||||
.TP
|
||||
\fB\-archivebuild-output\fR=\fIPATH\fR
|
||||
system \fIPATH\fR to output of the resulting .zip archive (use with archivebuild)
|
||||
@ -153,6 +149,18 @@ system \fIPATH\fR to output of the resulting .zip archive (use with archivebuild
|
||||
enable deflate compression in the .zip
|
||||
(no zip compression by default since it hurts compression of release packages)
|
||||
|
||||
.SH "EXAMPLES"
|
||||
.TP
|
||||
\fB1)\fR "Bob" will host a 2 player game on the Arcadia map:
|
||||
.nf
|
||||
-autostart="scenarios/Arcadia 02" -autostart-host -autostart-host-players=2 -autostart-playername="Bob"
|
||||
.fi
|
||||
.TP
|
||||
\fB2)\fR Load Alpine Lakes random map with random seed, 2 players (Athens and Britons), and player 2 is PetraBot:
|
||||
.nf
|
||||
-autostart="random/alpine_lakes" -autostart-seed=-1 -autostart-players=2 -autostart-civ=1:athen -autostart-civ=2:brit -autostart-ai=2:petra
|
||||
.fi
|
||||
|
||||
.SH "REPORTING BUGS"
|
||||
Bugs should be reported on Trac. For information on reporting problems
|
||||
and finding logs, see http://trac.wildfiregames.com/wiki/ReportingErrors
|
||||
|
40
0ad.spec
40
0ad.spec
@ -18,23 +18,24 @@
|
||||
%global without_nvtt 0
|
||||
|
||||
Name: 0ad
|
||||
Version: 0.0.16
|
||||
Release: 11%{?dist}
|
||||
Version: 0.0.17
|
||||
Release: 1%{?dist}
|
||||
# BSD License:
|
||||
# build/premake/*
|
||||
# libraries/valgrind/* (not built/used)
|
||||
# libraries/source/miniupnpc/* (not built/used)
|
||||
# libraries/source/valgrind/* (not built/used)
|
||||
# MIT License:
|
||||
# libraries/enet/*
|
||||
# libraries/fcollada/*
|
||||
# libraries/source/fcollada/*
|
||||
# libraries/source/nvtt/* (not built/used)
|
||||
# source/third_party/*
|
||||
# LGPLv2+
|
||||
# libraries/cxxtest/* (not built/used)
|
||||
# libraries/source/cxxtest*/* (not built/used)
|
||||
# GPLv2+
|
||||
# source/*
|
||||
# IBM
|
||||
# source/tools/fontbuilder2/Packer.py
|
||||
# MPL-1.1
|
||||
# libraries/spidermonkey/* (not built/used)
|
||||
# libraries/source/spidermonkey/* (not built/used)
|
||||
License: GPLv2+ and BSD and MIT and IBM
|
||||
Group: Amusements/Games
|
||||
Summary: Cross-Platform RTS Game of Ancient Warfare
|
||||
@ -68,8 +69,6 @@ Requires: %{name}-data = %{version}
|
||||
BuildRequires: boost-devel
|
||||
BuildRequires: cmake
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: DevIL-devel
|
||||
BuildRequires: enet-devel
|
||||
BuildRequires: gamin-devel
|
||||
BuildRequires: gloox-devel
|
||||
BuildRequires: libcurl-devel
|
||||
@ -82,7 +81,6 @@ BuildRequires: libxml2-devel
|
||||
BuildRequires: libzip-devel
|
||||
BuildRequires: miniupnpc-devel
|
||||
BuildRequires: mozjs24-devel
|
||||
BuildRequires: nasm
|
||||
%if %{with_system_nvtt}
|
||||
BuildRequires: nvidia-texture-tools-devel
|
||||
%endif
|
||||
@ -104,14 +102,8 @@ Patch0: %{name}-rpath.patch
|
||||
# It also prevents assumption there that it is building in x86
|
||||
Patch1: %{name}-debug.patch
|
||||
|
||||
# Build with miniupnpc-1.9
|
||||
Patch2: %{name}-miniupnpc.patch
|
||||
|
||||
# http://trac.wildfiregames.com/changeset/15334
|
||||
Patch3: changeset_15334.diff
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1141464
|
||||
Patch4: %{name}-valgrind.patch
|
||||
Patch3: %{name}-valgrind.patch
|
||||
|
||||
%description
|
||||
0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
|
||||
@ -133,12 +125,10 @@ hobbyist game developers, since 2001.
|
||||
# disable debug build, and "int 0x3" to trap to debugger (x86 only)
|
||||
%patch1 -p1
|
||||
%endif
|
||||
%patch2 -p1
|
||||
%patch3 -p3
|
||||
%patch4 -p1
|
||||
%patch3 -p1
|
||||
|
||||
%if %{with_system_nvtt}
|
||||
rm -fr libraries/nvtt
|
||||
rm -fr libraries/source/nvtt
|
||||
%endif
|
||||
|
||||
rm -fr libraries/source/valgrind
|
||||
@ -152,7 +142,6 @@ build/workspaces/update-workspaces.sh \
|
||||
--bindir %{_bindir} \
|
||||
--datadir %{_datadir}/%{name} \
|
||||
--libdir %{_libdir}/%{name} \
|
||||
--with-system-enet \
|
||||
--with-system-mozjs24 \
|
||||
--with-system-miniupnpc \
|
||||
%if %{with_system_nvtt}
|
||||
@ -169,7 +158,7 @@ make %{?_smp_mflags} -C build/workspaces/gcc config=%{config} verbose=1
|
||||
# Depends on availablity of nvtt
|
||||
%if !%{without_nvtt}
|
||||
%check
|
||||
LD_LIBRARY_PATH=binaries/system binaries/system/test%{dbg}
|
||||
LD_LIBRARY_PATH=binaries/system binaries/system/test%{dbg} -libdir binaries/system
|
||||
%endif
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
@ -232,6 +221,11 @@ export STRIP=/bin/true
|
||||
%{_mandir}/man6/*.6*
|
||||
|
||||
%changelog
|
||||
* Sun Oct 12 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.0.17-1
|
||||
- Update to latest upstream release
|
||||
- Remove no longer needed miniupnpc patch
|
||||
- Remove backport changeset_15334 patch
|
||||
|
||||
* Sun Sep 14 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.0.16-11
|
||||
- Remove unused valgrind sources and use system valgrind.h (#1141464)
|
||||
|
||||
|
@ -1,42 +0,0 @@
|
||||
Index: /ps/trunk/source/lib/allocators/headerless.cpp
|
||||
===================================================================
|
||||
--- /ps/trunk/source/lib/allocators/headerless.cpp (revision 15333)
|
||||
+++ /ps/trunk/source/lib/allocators/headerless.cpp (revision 15334)
|
||||
@@ -55,10 +55,12 @@
|
||||
}
|
||||
|
||||
- FreedBlock(uintptr_t id, size_t size)
|
||||
- : m_magic(s_magic), m_size(size), m_id(id)
|
||||
- {
|
||||
- }
|
||||
-
|
||||
- ~FreedBlock()
|
||||
+ void Setup(uintptr_t id, size_t size)
|
||||
+ {
|
||||
+ m_magic = s_magic;
|
||||
+ m_size = size;
|
||||
+ m_id = id;
|
||||
+ }
|
||||
+
|
||||
+ void Reset()
|
||||
{
|
||||
// clear all fields to prevent accidental reuse
|
||||
@@ -411,6 +413,7 @@
|
||||
FreedBlock* WriteTags(u8* p, size_t size)
|
||||
{
|
||||
- FreedBlock* freedBlock = new(p) FreedBlock(s_headerId, size);
|
||||
- (void)new(Footer(freedBlock)) FreedBlock(s_footerId, size);
|
||||
+ FreedBlock* freedBlock = (FreedBlock*)p;
|
||||
+ freedBlock->Setup(s_headerId, size);
|
||||
+ Footer(freedBlock)->Setup(s_footerId, size);
|
||||
|
||||
m_freeBlocks++;
|
||||
@@ -431,6 +434,6 @@
|
||||
|
||||
FreedBlock* footer = Footer(freedBlock);
|
||||
- freedBlock->~FreedBlock();
|
||||
- footer->~FreedBlock();
|
||||
+ freedBlock->Reset();
|
||||
+ footer->Reset();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user