@@ -202,7 +202,7 @@ namespace
202202 {
203203 int old = gl->ctextures ;
204204 gl->ctextures = (gl->ctextures == 0 ) ? 2 : gl->ctextures *2 ;
205- gl->textures = (struct GLNVGtexture *)BX_REALLOC (gl->allocator , gl->textures , sizeof (struct GLNVGtexture )*gl->ctextures );
205+ gl->textures = (struct GLNVGtexture *)bx::realloc (gl->allocator , gl->textures , sizeof (struct GLNVGtexture )*gl->ctextures );
206206 bx::memSet (&gl->textures [old], 0xff , (gl->ctextures -old)*sizeof (struct GLNVGtexture ) );
207207
208208 if (gl->textures == NULL )
@@ -837,7 +837,7 @@ namespace
837837 if (gl->ncalls +1 > gl->ccalls )
838838 {
839839 gl->ccalls = gl->ccalls == 0 ? 32 : gl->ccalls * 2 ;
840- gl->calls = (struct GLNVGcall *)BX_REALLOC (gl->allocator , gl->calls , sizeof (struct GLNVGcall ) * gl->ccalls );
840+ gl->calls = (struct GLNVGcall *)bx::realloc (gl->allocator , gl->calls , sizeof (struct GLNVGcall ) * gl->ccalls );
841841 }
842842 ret = &gl->calls [gl->ncalls ++];
843843 bx::memSet (ret, 0 , sizeof (struct GLNVGcall ) );
@@ -850,7 +850,7 @@ namespace
850850 if (gl->npaths + n > gl->cpaths ) {
851851 GLNVGpath* paths;
852852 int cpaths = glnvg__maxi (gl->npaths + n, 128 ) + gl->cpaths / 2 ; // 1.5x Overallocate
853- paths = (GLNVGpath*)BX_REALLOC (gl->allocator , gl->paths , sizeof (GLNVGpath) * cpaths);
853+ paths = (GLNVGpath*)bx::realloc (gl->allocator , gl->paths , sizeof (GLNVGpath) * cpaths);
854854 if (paths == NULL ) return -1 ;
855855 gl->paths = paths;
856856 gl->cpaths = cpaths;
@@ -867,7 +867,7 @@ namespace
867867 {
868868 NVGvertex* verts;
869869 int cverts = glnvg__maxi (gl->nverts + n, 4096 ) + gl->cverts /2 ; // 1.5x Overallocate
870- verts = (NVGvertex*)BX_REALLOC (gl->allocator , gl->verts , sizeof (NVGvertex) * cverts);
870+ verts = (NVGvertex*)bx::realloc (gl->allocator , gl->verts , sizeof (NVGvertex) * cverts);
871871 if (verts == NULL ) return -1 ;
872872 gl->verts = verts;
873873 gl->cverts = cverts;
@@ -883,7 +883,7 @@ namespace
883883 if (gl->nuniforms +n > gl->cuniforms )
884884 {
885885 gl->cuniforms = gl->cuniforms == 0 ? glnvg__maxi (n, 32 ) : gl->cuniforms * 2 ;
886- gl->uniforms = (unsigned char *)BX_REALLOC (gl->allocator , gl->uniforms , gl->cuniforms * structSize);
886+ gl->uniforms = (unsigned char *)bx::realloc (gl->allocator , gl->uniforms , gl->cuniforms * structSize);
887887 }
888888 ret = gl->nuniforms * structSize;
889889 gl->nuniforms += n;
@@ -1092,12 +1092,12 @@ namespace
10921092 }
10931093 }
10941094
1095- BX_FREE (gl->allocator , gl->uniforms );
1096- BX_FREE (gl->allocator , gl->verts );
1097- BX_FREE (gl->allocator , gl->paths );
1098- BX_FREE (gl->allocator , gl->calls );
1099- BX_FREE (gl->allocator , gl->textures );
1100- BX_FREE (gl->allocator , gl);
1095+ bx::free (gl->allocator , gl->uniforms );
1096+ bx::free (gl->allocator , gl->verts );
1097+ bx::free (gl->allocator , gl->paths );
1098+ bx::free (gl->allocator , gl->calls );
1099+ bx::free (gl->allocator , gl->textures );
1100+ bx::free (gl->allocator , gl);
11011101 }
11021102
11031103} // namespace
@@ -1112,7 +1112,7 @@ NVGcontext* nvgCreate(int32_t _edgeaa, bx::AllocatorI* _allocator)
11121112
11131113 struct NVGparams params;
11141114 struct NVGcontext * ctx = NULL ;
1115- struct GLNVGcontext * gl = (struct GLNVGcontext *)BX_ALLOC (_allocator, sizeof (struct GLNVGcontext ) );
1115+ struct GLNVGcontext * gl = (struct GLNVGcontext *)bx::alloc (_allocator, sizeof (struct GLNVGcontext ) );
11161116 if (gl == NULL )
11171117 {
11181118 goto error;
0 commit comments