Différences entre les versions de « T-shirt rmll-2018 »
De April MediaWiki
Aller à la navigationAller à la recherchem |
|||
Ligne 24 : | Ligne 24 : | ||
==Propositions de code à intégrer au visuel d'Antoine== | ==Propositions de code à intégrer au visuel d'Antoine== | ||
+ | === Proposition de PoluX === | ||
+ | La fonction free dans malloc/memusage.c de la [http://ftp.gnu.org/gnu/glibc/glibc-2.27.tar.gz libc GNU]. | ||
+ | |||
+ | <pre> | ||
+ | /* `free' replacement. We keep track of the memory usage if this is the | ||
+ | correct program. */ | ||
+ | void | ||
+ | free (void *ptr) | ||
+ | { | ||
+ | struct header *real; | ||
+ | |||
+ | /* Determine real implementation if not already happened. */ | ||
+ | if (__glibc_unlikely (initialized <= 0)) | ||
+ | { | ||
+ | if (initialized == -1) | ||
+ | return; | ||
+ | |||
+ | me (); | ||
+ | } | ||
+ | |||
+ | /* If this is not the correct program just use the normal function. */ | ||
+ | if (not_me) | ||
+ | { | ||
+ | (*freep) (ptr); | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | /* `free (NULL)' has no effect. */ | ||
+ | if (ptr == NULL) | ||
+ | { | ||
+ | catomic_increment (&calls[idx_free]); | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | /* Determine the pointer to the header. */ | ||
+ | real = ((struct header *) ptr) - 1; | ||
+ | if (real->magic != MAGIC) | ||
+ | { | ||
+ | /* This block wasn't allocated here. */ | ||
+ | (*freep) (ptr); | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | /* Keep track of number of calls. */ | ||
+ | catomic_increment (&calls[idx_free]); | ||
+ | /* Keep track of total memory freed using `free'. */ | ||
+ | catomic_add (&total[idx_free], real->length); | ||
+ | |||
+ | /* Update the allocation data and write out the records if necessary. */ | ||
+ | update_data (NULL, 0, real->length); | ||
+ | |||
+ | /* Do the real work. */ | ||
+ | (*freep) (real); | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | En version « compacte » : | ||
+ | <pre> | ||
+ | ~/glibc-2.27$ grep '^free (' malloc/memusage.c -B 3 -A 46 | tr '\n' ' ' | sed -e 's/[ ]\+/ /g' -e 's!/\*[^*]*\*/ !!g' | fold -w 35 | ||
+ | void free (void *ptr) { struct head | ||
+ | er *real; if (__glibc_unlikely (ini | ||
+ | tialized <= 0)) { if (initialized = | ||
+ | = -1) return; me (); } if (not_me) | ||
+ | { (*freep) (ptr); return; } if (ptr | ||
+ | == NULL) { catomic_increment (&cal | ||
+ | ls[idx_free]); return; } real = ((s | ||
+ | truct header *) ptr) - 1; if (real- | ||
+ | >magic != MAGIC) { (*freep) (ptr); | ||
+ | return; } catomic_increment (&calls | ||
+ | [idx_free]); catomic_add (&total[id | ||
+ | x_free], real->length); update_data | ||
+ | (NULL, 0, real->length); (*freep) | ||
+ | (real); } | ||
+ | </pre> | ||
==Couleur du tee-shirt== | ==Couleur du tee-shirt== | ||
Idéalement noir, pour faire ressortir les couleurs blanc et vert fluo du visuel et donner l'illusion d'un terminal. | Idéalement noir, pour faire ressortir les couleurs blanc et vert fluo du visuel et donner l'illusion d'un terminal. |
Version du 4 mai 2018 à 10:41
Projet de T-shirt à réaliser en vue des rmll 2018
Note : le même visuel sera utilisé pour la réalisation de deux autres goodies : tote bag et mug.
Il faudra probablement prévoir deux impressions et donc deux visuels pour le mug (logo au verso).
Slogans à partir du poème de Paul Eluard, Liberté
- Liberté, je code ton nom
- Liberté, je programme ton nom
Propositions graphiques
A partir du commentaire de Théo.
Source SVG: [1]
Reconditionnement de l’idée de Théo par Antoine (à finaliser).
Idéalement texte blanc remplacé par du code vraisemblable, même s'il n'est pas fonctionnel.
Propositions de code à intégrer au visuel d'Antoine
Proposition de PoluX
La fonction free dans malloc/memusage.c de la libc GNU.
/* `free' replacement. We keep track of the memory usage if this is the correct program. */ void free (void *ptr) { struct header *real; /* Determine real implementation if not already happened. */ if (__glibc_unlikely (initialized <= 0)) { if (initialized == -1) return; me (); } /* If this is not the correct program just use the normal function. */ if (not_me) { (*freep) (ptr); return; } /* `free (NULL)' has no effect. */ if (ptr == NULL) { catomic_increment (&calls[idx_free]); return; } /* Determine the pointer to the header. */ real = ((struct header *) ptr) - 1; if (real->magic != MAGIC) { /* This block wasn't allocated here. */ (*freep) (ptr); return; } /* Keep track of number of calls. */ catomic_increment (&calls[idx_free]); /* Keep track of total memory freed using `free'. */ catomic_add (&total[idx_free], real->length); /* Update the allocation data and write out the records if necessary. */ update_data (NULL, 0, real->length); /* Do the real work. */ (*freep) (real); }
En version « compacte » :
~/glibc-2.27$ grep '^free (' malloc/memusage.c -B 3 -A 46 | tr '\n' ' ' | sed -e 's/[ ]\+/ /g' -e 's!/\*[^*]*\*/ !!g' | fold -w 35 void free (void *ptr) { struct head er *real; if (__glibc_unlikely (ini tialized <= 0)) { if (initialized = = -1) return; me (); } if (not_me) { (*freep) (ptr); return; } if (ptr == NULL) { catomic_increment (&cal ls[idx_free]); return; } real = ((s truct header *) ptr) - 1; if (real- >magic != MAGIC) { (*freep) (ptr); return; } catomic_increment (&calls [idx_free]); catomic_add (&total[id x_free], real->length); update_data (NULL, 0, real->length); (*freep) (real); }
Couleur du tee-shirt
Idéalement noir, pour faire ressortir les couleurs blanc et vert fluo du visuel et donner l'illusion d'un terminal.