ReactOS 0.4.16-dev-2357-g35d0dfe
ftmemory.h File Reference
#include <ft2build.h>
#include <freetype/fttypes.h>
#include "compiler-macros.h"
Include dependency graph for ftmemory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FT_SET_ERROR(expression)    ( ( error = (expression) ) != 0 )
 
#define FT_OFFSET(base, count)   ( (base) ? (base) + (count) : NULL )
 
#define FT_ASSIGNP(p, val)   (p) = (val)
 
#define FT_DEBUG_INNER(exp)   (exp)
 
#define FT_ASSIGNP_INNER(p, exp)   FT_ASSIGNP( p, exp )
 
#define FT_MEM_ALLOC(ptr, size)
 
#define FT_MEM_FREE(ptr)
 
#define FT_MEM_NEW(ptr)    FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
 
#define FT_MEM_REALLOC(ptr, cursz, newsz)
 
#define FT_MEM_QALLOC(ptr, size)
 
#define FT_MEM_QNEW(ptr)    FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
 
#define FT_MEM_QREALLOC(ptr, cursz, newsz)
 
#define FT_MEM_ALLOC_MULT(ptr, count, item_size)
 
#define FT_MEM_REALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
 
#define FT_MEM_QALLOC_MULT(ptr, count, item_size)
 
#define FT_MEM_QREALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
 
#define FT_MEM_SET_ERROR(cond)   ( (cond), error != 0 )
 
#define FT_MEM_SET(dest, byte, count)    ft_memset( dest, byte, (FT_Offset)(count) )
 
#define FT_MEM_COPY(dest, source, count)    ft_memcpy( dest, source, (FT_Offset)(count) )
 
#define FT_MEM_MOVE(dest, source, count)    ft_memmove( dest, source, (FT_Offset)(count) )
 
#define FT_MEM_ZERO(dest, count)   FT_MEM_SET( dest, 0, count )
 
#define FT_ZERO(p)   FT_MEM_ZERO( p, sizeof ( *(p) ) )
 
#define FT_ARRAY_ZERO(dest, count)
 
#define FT_ARRAY_COPY(dest, source, count)
 
#define FT_ARRAY_MOVE(dest, source, count)
 
#define FT_ARRAY_MAX(ptr)   ( FT_INT_MAX / sizeof ( *(ptr) ) )
 
#define FT_ARRAY_CHECK(ptr, count)   ( (count) <= FT_ARRAY_MAX( ptr ) )
 
#define FT_MEM_NEW_ARRAY(ptr, count)
 
#define FT_MEM_RENEW_ARRAY(ptr, cursz, newsz)
 
#define FT_MEM_QNEW_ARRAY(ptr, count)
 
#define FT_MEM_QRENEW_ARRAY(ptr, cursz, newsz)
 
#define FT_ALLOC(ptr, size)    FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
 
#define FT_REALLOC(ptr, cursz, newsz)    FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
 
#define FT_ALLOC_MULT(ptr, count, item_size)    FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
 
#define FT_REALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
 
#define FT_QALLOC(ptr, size)    FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
 
#define FT_QREALLOC(ptr, cursz, newsz)    FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
 
#define FT_QALLOC_MULT(ptr, count, item_size)    FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
 
#define FT_QREALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
 
#define FT_FREE(ptr)   FT_MEM_FREE( ptr )
 
#define FT_NEW(ptr)   FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
 
#define FT_NEW_ARRAY(ptr, count)    FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
 
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)    FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
 
#define FT_QNEW(ptr)    FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
 
#define FT_QNEW_ARRAY(ptr, count)    FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
 
#define FT_QRENEW_ARRAY(ptr, curcnt, newcnt)    FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
 
#define FT_MEM_STRDUP(dst, str)    (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
 
#define FT_STRDUP(dst, str)    FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
 
#define FT_MEM_DUP(dst, address, size)    (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
 
#define FT_DUP(dst, address, size)    FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
 
#define FT_STRCPYN(dst, src, size)    ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )
 

Functions

 ft_mem_alloc (FT_Memory memory, FT_Long size, FT_Error *p_error)
 
 ft_mem_qalloc (FT_Memory memory, FT_Long size, FT_Error *p_error)
 
 ft_mem_realloc (FT_Memory memory, FT_Long item_size, FT_Long cur_count, FT_Long new_count, void *block, FT_Error *p_error)
 
 ft_mem_qrealloc (FT_Memory memory, FT_Long item_size, FT_Long cur_count, FT_Long new_count, void *block, FT_Error *p_error)
 
 ft_mem_free (FT_Memory memory, const void *P)
 
 ft_mem_strdup (FT_Memory memory, const char *str, FT_Error *p_error)
 
 ft_mem_dup (FT_Memory memory, const void *address, FT_ULong size, FT_Error *p_error)
 
 ft_mem_strcpyn (char *dst, const char *src, FT_ULong size)
 

Macro Definition Documentation

◆ FT_ALLOC

#define FT_ALLOC (   ptr,
  size 
)     FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )

Definition at line 311 of file ftmemory.h.

◆ FT_ALLOC_MULT

#define FT_ALLOC_MULT (   ptr,
  count,
  item_size 
)     FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )

Definition at line 317 of file ftmemory.h.

◆ FT_ARRAY_CHECK

#define FT_ARRAY_CHECK (   ptr,
  count 
)    ( (count) <= FT_ARRAY_MAX( ptr ) )

Definition at line 270 of file ftmemory.h.

◆ FT_ARRAY_COPY

#define FT_ARRAY_COPY (   dest,
  source,
  count 
)
Value:
source, \
(FT_Offset)(count) * sizeof ( *(dest) ) )
#define FT_MEM_COPY(dest, source, count)
Definition: ftmemory.h:237
size_t FT_Offset
Definition: fttypes.h:323
GLuint GLuint GLsizei count
Definition: gl.h:1545
static char * dest
Definition: rtl.c:135

Definition at line 253 of file ftmemory.h.

◆ FT_ARRAY_MAX

#define FT_ARRAY_MAX (   ptr)    ( FT_INT_MAX / sizeof ( *(ptr) ) )

Definition at line 268 of file ftmemory.h.

◆ FT_ARRAY_MOVE

#define FT_ARRAY_MOVE (   dest,
  source,
  count 
)
Value:
source, \
(FT_Offset)(count) * sizeof ( *(dest) ) )
#define FT_MEM_MOVE(dest, source, count)
Definition: ftmemory.h:240

Definition at line 258 of file ftmemory.h.

◆ FT_ARRAY_ZERO

#define FT_ARRAY_ZERO (   dest,
  count 
)
Value:
(FT_Offset)(count) * sizeof ( *(dest) ) )
#define FT_MEM_ZERO(dest, count)
Definition: ftmemory.h:244

Definition at line 249 of file ftmemory.h.

◆ FT_ASSIGNP

#define FT_ASSIGNP (   p,
  val 
)    (p) = (val)

Definition at line 91 of file ftmemory.h.

◆ FT_ASSIGNP_INNER

#define FT_ASSIGNP_INNER (   p,
  exp 
)    FT_ASSIGNP( p, exp )

Definition at line 113 of file ftmemory.h.

◆ FT_DEBUG_INNER

#define FT_DEBUG_INNER (   exp)    (exp)

Definition at line 112 of file ftmemory.h.

◆ FT_DUP

#define FT_DUP (   dst,
  address,
  size 
)     FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )

Definition at line 378 of file ftmemory.h.

◆ FT_FREE

#define FT_FREE (   ptr)    FT_MEM_FREE( ptr )

Definition at line 337 of file ftmemory.h.

◆ FT_MEM_ALLOC

#define FT_MEM_ALLOC (   ptr,
  size 
)
Value:
(FT_Long)(size), \
&error ) )
ft_mem_alloc(FT_Memory memory, FT_Long size, FT_Error *p_error)
Definition: ftutil.c:49
#define FT_ASSIGNP_INNER(p, exp)
Definition: ftmemory.h:113
signed long FT_Long
Definition: fttypes.h:242
GLsizeiptr size
Definition: glext.h:5919
#define error(str)
Definition: mkdosfs.c:1605
static PVOID ptr
Definition: dispmode.c:27
static char memory[1024 *256]
Definition: process.c:122

Definition at line 160 of file ftmemory.h.

◆ FT_MEM_ALLOC_MULT

#define FT_MEM_ALLOC_MULT (   ptr,
  count,
  item_size 
)
Value:
(FT_Long)(item_size), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )
#define NULL
Definition: types.h:112
ft_mem_realloc(FT_Memory memory, FT_Long item_size, FT_Long cur_count, FT_Long new_count, void *block, FT_Error *p_error)
Definition: ftutil.c:91

Definition at line 198 of file ftmemory.h.

◆ FT_MEM_COPY

#define FT_MEM_COPY (   dest,
  source,
  count 
)     ft_memcpy( dest, source, (FT_Offset)(count) )

Definition at line 237 of file ftmemory.h.

◆ FT_MEM_DUP

#define FT_MEM_DUP (   dst,
  address,
  size 
)     (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )

Definition at line 375 of file ftmemory.h.

◆ FT_MEM_FREE

#define FT_MEM_FREE (   ptr)
Value:
FT_BEGIN_STMNT \
FT_DEBUG_INNER( ft_mem_free( memory, (ptr) ) ); \
(ptr) = NULL; \
#define FT_END_STMNT
ft_mem_free(FT_Memory memory, const void *P)
Definition: ftutil.c:169

Definition at line 165 of file ftmemory.h.

◆ FT_MEM_MOVE

#define FT_MEM_MOVE (   dest,
  source,
  count 
)     ft_memmove( dest, source, (FT_Offset)(count) )

Definition at line 240 of file ftmemory.h.

◆ FT_MEM_NEW

#define FT_MEM_NEW (   ptr)     FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )

Definition at line 171 of file ftmemory.h.

◆ FT_MEM_NEW_ARRAY

#define FT_MEM_NEW_ARRAY (   ptr,
  count 
)
Value:
sizeof ( *(ptr) ), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )

Definition at line 279 of file ftmemory.h.

◆ FT_MEM_QALLOC

#define FT_MEM_QALLOC (   ptr,
  size 
)
Value:
(FT_Long)(size), \
&error ) )
ft_mem_qalloc(FT_Memory memory, FT_Long size, FT_Error *p_error)
Definition: ftutil.c:65

Definition at line 182 of file ftmemory.h.

◆ FT_MEM_QALLOC_MULT

#define FT_MEM_QALLOC_MULT (   ptr,
  count,
  item_size 
)
Value:
(FT_Long)(item_size), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )
ft_mem_qrealloc(FT_Memory memory, FT_Long item_size, FT_Long cur_count, FT_Long new_count, void *block, FT_Error *p_error)
Definition: ftutil.c:113

Definition at line 214 of file ftmemory.h.

◆ FT_MEM_QNEW

#define FT_MEM_QNEW (   ptr)     FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )

Definition at line 187 of file ftmemory.h.

◆ FT_MEM_QNEW_ARRAY

#define FT_MEM_QNEW_ARRAY (   ptr,
  count 
)
Value:
sizeof ( *(ptr) ), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )

Definition at line 295 of file ftmemory.h.

◆ FT_MEM_QREALLOC

#define FT_MEM_QREALLOC (   ptr,
  cursz,
  newsz 
)
Value:
1, \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 190 of file ftmemory.h.

◆ FT_MEM_QREALLOC_MULT

#define FT_MEM_QREALLOC_MULT (   ptr,
  oldcnt,
  newcnt,
  itmsz 
)
Value:
(FT_Long)(itmsz), \
(FT_Long)(oldcnt), \
(FT_Long)(newcnt), \
(ptr), \
&error ) )

Definition at line 222 of file ftmemory.h.

◆ FT_MEM_QRENEW_ARRAY

#define FT_MEM_QRENEW_ARRAY (   ptr,
  cursz,
  newsz 
)
Value:
sizeof ( *(ptr) ), \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 303 of file ftmemory.h.

◆ FT_MEM_REALLOC

#define FT_MEM_REALLOC (   ptr,
  cursz,
  newsz 
)
Value:
1, \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 174 of file ftmemory.h.

◆ FT_MEM_REALLOC_MULT

#define FT_MEM_REALLOC_MULT (   ptr,
  oldcnt,
  newcnt,
  itmsz 
)
Value:
(FT_Long)(itmsz), \
(FT_Long)(oldcnt), \
(FT_Long)(newcnt), \
(ptr), \
&error ) )

Definition at line 206 of file ftmemory.h.

◆ FT_MEM_RENEW_ARRAY

#define FT_MEM_RENEW_ARRAY (   ptr,
  cursz,
  newsz 
)
Value:
sizeof ( *(ptr) ), \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 287 of file ftmemory.h.

◆ FT_MEM_SET

#define FT_MEM_SET (   dest,
  byte,
  count 
)     ft_memset( dest, byte, (FT_Offset)(count) )

Definition at line 234 of file ftmemory.h.

◆ FT_MEM_SET_ERROR

#define FT_MEM_SET_ERROR (   cond)    ( (cond), error != 0 )

Definition at line 231 of file ftmemory.h.

◆ FT_MEM_STRDUP

#define FT_MEM_STRDUP (   dst,
  str 
)     (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )

Definition at line 369 of file ftmemory.h.

◆ FT_MEM_ZERO

#define FT_MEM_ZERO (   dest,
  count 
)    FT_MEM_SET( dest, 0, count )

Definition at line 244 of file ftmemory.h.

◆ FT_NEW

#define FT_NEW (   ptr)    FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )

Definition at line 339 of file ftmemory.h.

◆ FT_NEW_ARRAY

#define FT_NEW_ARRAY (   ptr,
  count 
)     FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )

Definition at line 341 of file ftmemory.h.

◆ FT_OFFSET

#define FT_OFFSET (   base,
  count 
)    ( (base) ? (base) + (count) : NULL )

Definition at line 66 of file ftmemory.h.

◆ FT_QALLOC

#define FT_QALLOC (   ptr,
  size 
)     FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )

Definition at line 324 of file ftmemory.h.

◆ FT_QALLOC_MULT

#define FT_QALLOC_MULT (   ptr,
  count,
  item_size 
)     FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )

Definition at line 330 of file ftmemory.h.

◆ FT_QNEW

#define FT_QNEW (   ptr)     FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )

Definition at line 347 of file ftmemory.h.

◆ FT_QNEW_ARRAY

#define FT_QNEW_ARRAY (   ptr,
  count 
)     FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )

Definition at line 350 of file ftmemory.h.

◆ FT_QREALLOC

#define FT_QREALLOC (   ptr,
  cursz,
  newsz 
)     FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )

Definition at line 327 of file ftmemory.h.

◆ FT_QREALLOC_MULT

#define FT_QREALLOC_MULT (   ptr,
  oldcnt,
  newcnt,
  itmsz 
)
Value:
newcnt, itmsz ) )
#define FT_MEM_SET_ERROR(cond)
Definition: ftmemory.h:231
#define FT_MEM_QREALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
Definition: ftmemory.h:222

Definition at line 333 of file ftmemory.h.

◆ FT_QRENEW_ARRAY

#define FT_QRENEW_ARRAY (   ptr,
  curcnt,
  newcnt 
)     FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )

Definition at line 353 of file ftmemory.h.

◆ FT_REALLOC

#define FT_REALLOC (   ptr,
  cursz,
  newsz 
)     FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )

Definition at line 314 of file ftmemory.h.

◆ FT_REALLOC_MULT

#define FT_REALLOC_MULT (   ptr,
  oldcnt,
  newcnt,
  itmsz 
)
Value:
newcnt, itmsz ) )
#define FT_MEM_REALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
Definition: ftmemory.h:206

Definition at line 320 of file ftmemory.h.

◆ FT_RENEW_ARRAY

#define FT_RENEW_ARRAY (   ptr,
  curcnt,
  newcnt 
)     FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )

Definition at line 344 of file ftmemory.h.

◆ FT_SET_ERROR

#define FT_SET_ERROR (   expression)     ( ( error = (expression) ) != 0 )

Definition at line 43 of file ftmemory.h.

◆ FT_STRCPYN

#define FT_STRCPYN (   dst,
  src,
  size 
)     ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )

Definition at line 390 of file ftmemory.h.

◆ FT_STRDUP

#define FT_STRDUP (   dst,
  str 
)     FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )

Definition at line 372 of file ftmemory.h.

◆ FT_ZERO

#define FT_ZERO (   p)    FT_MEM_ZERO( p, sizeof ( *(p) ) )

Definition at line 246 of file ftmemory.h.

Function Documentation

◆ ft_mem_alloc()

ft_mem_alloc ( FT_Memory  memory,
FT_Long  size,
FT_Error p_error 
)

Definition at line 49 of file ftutil.c.

52 {
55
56 if ( !error && block && size > 0 )
58
59 *p_error = error;
60 return block;
61 }
int FT_Error
Definition: fttypes.h:299
ft_mem_qalloc(FT_Memory memory, FT_Long size, FT_Error *p_error)
Definition: ftutil.c:65
static unsigned int block
Definition: xmlmemory.c:101

◆ ft_mem_dup()

ft_mem_dup ( FT_Memory  memory,
const void address,
FT_ULong  size,
FT_Error p_error 
)

Definition at line 178 of file ftutil.c.

182 {
185
186
187 if ( !error && address && size > 0 )
188 ft_memcpy( p, address, size );
189
190 *p_error = error;
191 return p;
192 }
#define ft_memcpy
Definition: ftstdlib.h:82
GLuint address
Definition: glext.h:9393
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by ft_mem_strdup().

◆ ft_mem_free()

ft_mem_free ( FT_Memory  memory,
const void P 
)

Definition at line 169 of file ftutil.c.

171 {
172 if ( P )
173 memory->free( memory, (void*)P );
174 }
#define P(row, col)

Referenced by ft_mem_qrealloc(), FT_Stream_ExitFrame(), and FT_Stream_ReleaseFrame().

◆ ft_mem_qalloc()

ft_mem_qalloc ( FT_Memory  memory,
FT_Long  size,
FT_Error p_error 
)

Definition at line 65 of file ftutil.c.

68 {
71
72
73 if ( size > 0 )
74 {
75 block = memory->alloc( memory, size );
76 if ( !block )
77 error = FT_THROW( Out_Of_Memory );
78 }
79 else if ( size < 0 )
80 {
81 /* may help catch/prevent security issues */
82 error = FT_THROW( Invalid_Argument );
83 }
84
85 *p_error = error;
86 return block;
87 }
return FT_Err_Ok
Definition: ftbbox.c:526
#define FT_THROW(e)
Definition: ftdebug.h:243

Referenced by ft_mem_alloc(), ft_mem_dup(), and FT_Stream_EnterFrame().

◆ ft_mem_qrealloc()

ft_mem_qrealloc ( FT_Memory  memory,
FT_Long  item_size,
FT_Long  cur_count,
FT_Long  new_count,
void block,
FT_Error p_error 
)

Definition at line 113 of file ftutil.c.

119 {
121
122
123 /* Note that we now accept `item_size == 0' as a valid parameter, in
124 * order to cover very weird cases where an ALLOC_MULT macro would be
125 * called.
126 */
127 if ( cur_count < 0 || new_count < 0 || item_size < 0 )
128 {
129 /* may help catch/prevent nasty security issues */
130 error = FT_THROW( Invalid_Argument );
131 }
132 else if ( new_count == 0 || item_size == 0 )
133 {
135 block = NULL;
136 }
137 else if ( new_count > FT_INT_MAX / item_size )
138 {
139 error = FT_THROW( Array_Too_Large );
140 }
141 else if ( cur_count == 0 )
142 {
143 FT_ASSERT( !block );
144
145 block = memory->alloc( memory, new_count * item_size );
146 if ( block == NULL )
147 error = FT_THROW( Out_Of_Memory );
148 }
149 else
150 {
152 FT_Long cur_size = cur_count * item_size;
153 FT_Long new_size = new_count * item_size;
154
155
156 block2 = memory->realloc( memory, cur_size, new_size, block );
157 if ( !block2 )
158 error = FT_THROW( Out_Of_Memory );
159 else
160 block = block2;
161 }
162
163 *p_error = error;
164 return block;
165 }
size_t const new_size
Definition: expand.cpp:66
#define FT_ASSERT(condition)
Definition: ftdebug.h:241
#define FT_INT_MAX
Definition: ftstdlib.h:63
ft_mem_free(FT_Memory memory, const void *P)
Definition: ftutil.c:169
static const struct metadata_block block2[]
Definition: metadata.c:3639

Referenced by ft_mem_realloc().

◆ ft_mem_realloc()

ft_mem_realloc ( FT_Memory  memory,
FT_Long  item_size,
FT_Long  cur_count,
FT_Long  new_count,
void block,
FT_Error p_error 
)

Definition at line 91 of file ftutil.c.

97 {
99
100
101 block = ft_mem_qrealloc( memory, item_size,
102 cur_count, new_count, block, &error );
103 if ( !error && block && new_count > cur_count )
104 FT_MEM_ZERO( (char*)block + cur_count * item_size,
105 ( new_count - cur_count ) * item_size );
106
107 *p_error = error;
108 return block;
109 }
ft_mem_qrealloc(FT_Memory memory, FT_Long item_size, FT_Long cur_count, FT_Long new_count, void *block, FT_Error *p_error)
Definition: ftutil.c:113

◆ ft_mem_strcpyn()

ft_mem_strcpyn ( char dst,
const char src,
FT_ULong  size 
)

Definition at line 209 of file ftutil.c.

212 {
213 while ( size > 1 && *src != 0 )
214 {
215 *dst++ = *src++;
216 size--;
217 }
218
219 *dst = 0; /* always zero-terminate */
220
221 return *src != 0;
222 }
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

◆ ft_mem_strdup()

ft_mem_strdup ( FT_Memory  memory,
const char str,
FT_Error p_error 
)

Definition at line 196 of file ftutil.c.

199 {
201 : 0;
202
203
204 return ft_mem_dup( memory, str, len, p_error );
205 }
#define ft_strlen
Definition: ftstdlib.h:88
unsigned long FT_ULong
Definition: fttypes.h:253
ft_mem_dup(FT_Memory memory, const void *address, FT_ULong size, FT_Error *p_error)
Definition: ftutil.c:178
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str