Ignore:
Timestamp:
Feb 4, 2016, 6:25:22 PM (8 years ago)
Author:
meunier
Message:
  • Ajout de quelques fonction dans la lib math
  • Déplacement de certaines fonctions de stdlib vers string
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/malloc.c

    r709 r777  
    88#include "malloc.h"
    99#include "stdio.h"
     10#include "stdlib.h"
    1011#include "giet_config.h"
    1112
     
    214215
    215216////////////////////////////////////////
    216 void * remote_malloc( unsigned int size,
     217void * remote_malloc( int size,
    217218                      unsigned int x,
    218219                      unsigned int y )
     
    278279#endif
    279280
    280     return (void*)base;
     281    return (void*) base;
    281282
    282283} // end remote_malloc()
     
    284285
    285286//////////////////////////////////
    286 void * malloc( unsigned int size )
     287void * malloc( int size )
    287288{
    288289    // get cluster coordinates
    289     unsigned int    x;
    290     unsigned int    y;
    291     unsigned int    lpid;
     290    unsigned int x;
     291    unsigned int y;
     292    unsigned int lpid;
    292293    giet_proc_xyp( &x, &y, &lpid );
    293294
    294295    return remote_malloc( size, x, y );
    295296}
     297
     298
     299////////////////////////////////////
     300void * calloc ( int nbmem, int size )
     301{
     302    void * a = malloc( nbmem * size );
     303    memset( a, 0, nbmem * size );
     304    return a;
     305}
    296306
    297307///////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.