mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 16:46:40 +00:00
Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
#include "precompiled.h"
|
||||
#include "ScriptableComplex.h"
|
||||
|
||||
// suballocator for CJSComplex.m_Properties elements
|
||||
static Bucket bucket;
|
||||
// HACK: it needs to be created/destroyed; since there is no
|
||||
// global init/shutdown call here, we keep a refcnt. this assumes that
|
||||
// going to 0 <==> shutdown! if that proves wrong, bucket_alloc will warn.
|
||||
static uint suballoc_refs; // initialized in suballoc_attach
|
||||
|
||||
void jscomplexproperty_suballoc_attach()
|
||||
{
|
||||
ONCE(\
|
||||
size_t el_size = MAX(sizeof(CJSValComplexProperty), sizeof(CJSComplexProperty<int, true>));\
|
||||
(void)bucket_create(&bucket, el_size);\
|
||||
suballoc_refs = 0;\
|
||||
);
|
||||
suballoc_refs++;
|
||||
}
|
||||
|
||||
void jscomplexproperty_suballoc_detach()
|
||||
{
|
||||
suballoc_refs--;
|
||||
if(suballoc_refs == 0)
|
||||
bucket_destroy(&bucket);
|
||||
}
|
||||
|
||||
void* jscomplexproperty_suballoc()
|
||||
{
|
||||
return bucket_alloc(&bucket, 0);
|
||||
}
|
||||
|
||||
void jscomplexproperty_suballoc_free(IJSComplexProperty* p)
|
||||
{
|
||||
// explicit dtor since caller uses placement new
|
||||
p->~IJSComplexProperty();
|
||||
bucket_free(&bucket, p);
|
||||
}
|
||||
#include "precompiled.h"
|
||||
#include "ScriptableComplex.h"
|
||||
|
||||
// suballocator for CJSComplex.m_Properties elements
|
||||
static Bucket bucket;
|
||||
// HACK: it needs to be created/destroyed; since there is no
|
||||
// global init/shutdown call here, we keep a refcnt. this assumes that
|
||||
// going to 0 <==> shutdown! if that proves wrong, bucket_alloc will warn.
|
||||
static uint suballoc_refs; // initialized in suballoc_attach
|
||||
|
||||
void jscomplexproperty_suballoc_attach()
|
||||
{
|
||||
ONCE(\
|
||||
size_t el_size = MAX(sizeof(CJSValComplexProperty), sizeof(CJSComplexProperty<int, true>));\
|
||||
(void)bucket_create(&bucket, el_size);\
|
||||
suballoc_refs = 0;\
|
||||
);
|
||||
suballoc_refs++;
|
||||
}
|
||||
|
||||
void jscomplexproperty_suballoc_detach()
|
||||
{
|
||||
suballoc_refs--;
|
||||
if(suballoc_refs == 0)
|
||||
bucket_destroy(&bucket);
|
||||
}
|
||||
|
||||
void* jscomplexproperty_suballoc()
|
||||
{
|
||||
return bucket_alloc(&bucket, 0);
|
||||
}
|
||||
|
||||
void jscomplexproperty_suballoc_free(IJSComplexProperty* p)
|
||||
{
|
||||
// explicit dtor since caller uses placement new
|
||||
p->~IJSComplexProperty();
|
||||
bucket_free(&bucket, p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user