Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/Unipisa/CMM
13 July 2022, 09:41:13 UTC
  • Code
  • Branches (2)
  • Releases (8)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/SourceCode
    • refs/heads/master
    • 1.9
    • 1.8
    • 1.7
    • 1.6
    • 1.5
    • 1.4
    • 1.3
    • 1.1
  • db1a798
  • /
  • cmm
  • /
  • test3.cpp
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
  • release
origin badgecontent badge Iframe embedding
swh:1:cnt:09b7d950c7f7d9627813541e3f32bdfad68bf861
origin badgedirectory badge Iframe embedding
swh:1:dir:78af2ccbb0a8bb0b518d4ba147a0eec0624b1f97
origin badgerevision badge
swh:1:rev:55778ad8b99c136e1886959c1f1333c776df14e1
origin badgesnapshot badge
swh:1:snp:4ac4ed834489429d51fc0fd004f10ddbf78d807a
origin badgerelease badge
swh:1:rel:a6a00f689665e8e5b730fb4706b03c463146259a
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
  • release
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 55778ad8b99c136e1886959c1f1333c776df14e1 authored by Giuseppe Attardi on 15 May 1997, 06:24:54 UTC
1.8 -
Tip revision: 55778ad
test3.cpp
/* This program is used to test the ability of DefaultHeap::alloc()
   to recover from heap allocation failures.  It is run:

	expand [<initial heap> [<max heap> [<increment>]]]

   where all values are optional and expressed in megabytes.
*/

#include <stdio.h>
#include <string.h>
#include <ctype.h>

#include "cmm.h"

#define MB  1048576

/* The basic data structure is a list of blocks.  */

struct  block : CmmObject {
  block*  prev;
  int  number[25000];
  block(block* ptr, int x);
  void traverse();
};

void
block::traverse()
{
  Cmm::heap->scavenge((CmmObject **)&prev);
}

block::block(block* ptr, int x)
{
	prev = ptr;
	for  (int i = 0 ; i < 25000 ; i++)  number[i] = x;
}

void
makeheap(int initial, int final, int inc)
{
  Cmm dummy(initial*MB, final*MB, inc*MB,
	    0, 1, CMM_GCTHRESHOLD, CMM_FLAGS, 0);
}

void
main(int argc, char* argv[])
{
	block  *lp = NULL;
	int  i, max;

	max = (argc < 3) ? 50 : atoi(argv[2]);
	makeheap((argc == 1) ? 1 : atoi(argv[1]),
		  max,
		  (argc < 4) ? 2 : atoi(argv[3]));
	printf("Will try to allocate up to %dMB of heap\n", max);
	for  (i = 0 ; i < 20; i++)  {
	   lp = new block(lp, i);
	   Cmm::heap->collect();
	}
	lp = new block(lp, i);
	Cmm::heap->collect();
	lp = new block(lp, i+1);
	Cmm::heap->collect();
	i = 0;
	while  (lp != NULL)  {
	   printf("%d %d ", lp->number[0], lp->number[24999]);
	   lp = lp->prev;
	   if  (++i % 10 == 0)  printf("\n");
	}
	printf("\n");
	exit(0);
}

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top